home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-08-27 | 1.6 KB | 62 lines | [TEXT/CWIE] |
- /*
- File: LColorPicker.h
-
- Contains: Support for modeless and movable modal color pickers.
-
- Written by: Chris Thomas
-
- Copyright: © 1995 Chris K. Thomas. All Rights Reserved.
-
- Documentation in .cp.
- */
-
- // * comment out this line if not using PowerPlant
- // * our you don't want this class to be LSharable
- #include <PP_Prefix.h>
-
- #include <ColorPicker.h>
-
- #if (defined __PowerPlant__)
- #include <LSharable.h>
- #endif
-
- class LColorPicker
- #if (defined __PowerPlant__)
- : public LSharable
- #endif
- {
- RGBColor mCurrentColor;
- picker mPicker; // * 2.0 Picker
- GrafPtr mSavePort;
-
- static ColorChangedUPP sColorChangeUpp;
-
- public:
- LColorPicker(StringPtr inPrompt, RGBColor& inOldColor,
- Boolean isMovable, Boolean isModal);
- virtual ~LColorPicker();
-
- // * accessors
- void SetColor(RGBColor &inColor, ColorType inColorType);
- void GetColor(RGBColor &outColor);
- void SetPrompt(const StringPtr inPrompt);
-
- // * events
- short HandleEvent(EventRecord *inEvent);
-
- // * call before deleting. if not, don't delete.
- Boolean CanClose();
-
- protected:
-
- // * subclass overrides for 2.0
- virtual void GetMenuItems(PickerMenuItemInfo &outInfo) {};
-
- virtual void UserChangingColor() {} // called live when user changes a color
- virtual void UserFinalizedColor() {} // called when user finalizes a color change
- virtual void UserSaysOK() {} // user hit OK
- virtual void UserSaysCancel() {} // user hit Cancel
-
- // * callback proc->method tranforms
- static pascal void ColorChangeProc(LColorPicker *inInstance, PMColor *inNewColor);
- };